<%@ page language="java" import="dao.*" pageEncoding="UTF-8" %>
 <%@ page language="java" import="java.util.*" %>
 <%@page import="util.*" %>
<%
String orderId = Request.get("order", "id");
String sortId = Request.get("sort", "desc");
util.Execl xls = new util.Execl();
xls.addCol("id", "ID");

xls.addCol("xuehao", "学号");

xls.addCol("xingming", "姓名");

xls.addCol("ruxueshijian", "入学时间");

xls.addCol("lianxidianhua", "联系电话");

xls.addColSelect("xueqi", "学期", "xueqixinxi", "id", "xueqimingcheng", 0);

xls.addColSelect("banji", "班级", "banjixinxi", "id", "banjimingcheng", 0);

xls.addCol("chushengnianyueri", "出生年月日");

xls.addCol("jiguan", "籍贯");

xls.addCol("hukouleixing", "户口类型");

xls.addCol("zhengzhimianmao", "政治面貌");

xls.addCol("xuejizhuangtai", "学籍状态");

xls.addCol("jiatingdizhi", "家庭地址");

xls.addCol("jinjilianxiren", "紧急联系人");

xls.addCol("lianxirendianhua", "联系人电话");

xls.addCol("beizhu", "备注");

// 下面是数据，数据需要经过处理
String where = " 1=1 ";

if (request.getParameter("xueshengxinxiid") != null && !"".equals(request.getParameter("xueshengxinxiid"))) {
    where += " AND xueshengxinxiid='" + request.getParameter("xueshengxinxiid") + "' ";
}
if (request.getParameter("xuehao") != null && !"".equals(request.getParameter("xuehao"))) {
    where += " AND xuehao LIKE '%" + request.getParameter("xuehao") + "%'";
}
if (request.getParameter("xueqi") != null && !"".equals(request.getParameter("xueqi"))) {
    where += " AND xueqi ='" + request.getParameter("xueqi") + "'";
}
if (request.getParameter("banji") != null && !"".equals(request.getParameter("banji"))) {
    where += " AND banji ='" + request.getParameter("banji") + "'";
}
if (request.getParameter("chushengnianyueri_start") != null && !"".equals(request.getParameter("chushengnianyueri_start"))) {
    where += " AND chushengnianyueri >='" + request.getParameter("chushengnianyueri_start") + "' ";
}
if (request.getParameter("chushengnianyueri_end") != null && !"".equals(request.getParameter("chushengnianyueri_end"))) {
    where += " AND chushengnianyueri <='" + request.getParameter("chushengnianyueri_end") + "' ";
}
List<Map> list = Query.make("xuejixinxi").where(where).order(orderId + " " + sortId).select();

xls.addData(list);
xls.export("xuejixinxi", response);
%>

